properties { 
  $base_dir  = resolve-path . #Split-Path (Split-Path $myinvocation.mycommand.path )
  $lib_dir = "$base_dir\Library"
  $build_dir = "$base_dir\BuildOutput\" 
  $sln_file = "$base_dir\CleanTest.sln" 
  $version = "0.0.0.1"
  $humanReadableversion = "0.0"
  $tools_dir = "$base_dir\Tools"
  $release_dir = "$base_dir\Release" 
} 

include .\psake_ext.ps1
include .\x64detection.ps1
	
task default -depends Compile

task Clean { 
  remove-item -force -recurse $build_dir -ErrorAction SilentlyContinue 
  remove-item -force -recurse $release_dir -ErrorAction SilentlyContinue 
  Build-SharedLibs-For-Processor 
} 

task Init -depends Clean { 
	Generate-Assembly-Info `
		-file "$base_dir\CleanTest\Properties\AssemblyInfo.cs" `
		-title "CleanTest $version" `
		-description "C" `
		-company "Rhys Campbell" `
		-product "CleanTest $version" `
		-version $version `
		-copyright "Rhys Campbell 2010"
		
	Generate-Assembly-Info `
		-file "$base_dir\CleanTest.Tests\Properties\AssemblyInfo.cs" `
		-title "CleanTest Tests $version" `
		-description "CleanTest" `
		-company "Rhys Campbell" `
		-product "CleanTest Tests $version" `
		-version $version `
		-clsCompliant "false" `
		-copyright "Rhys Campbell 2010"
		
	new-item $release_dir -itemType directory 
	new-item $build_dir -itemType directory 
} 

task Compile -depends Init { 
  exec msbuild "/p:OutDir=""$build_dir "" $sln_file"
} 